import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:sports_new/resources/umeng_middleware.dart';
import 'package:sports_new/view/expert/expert_all_page.dart';
import 'package:sports_new/view/expert/expert_league_list_page.dart';
import 'package:sports_new/view/expert/expert_leagues_page.dart';
import 'package:sports_new/view/expert/plan_list/plan_form_detail_page.dart';
import 'package:sports_new/view/expert/plan_list/plan_form_page.dart';
import 'package:sports_new/view/expert/plan_pack/plan_pack_detail_page.dart';
import 'package:sports_new/view/expert/plan_pack/plan_pack_page.dart';
import 'package:sports_new/view/expert/top/expert_top_page.dart';
import 'package:sports_new/view/expert/viewpoint_page.dart';
import 'package:sports_new/view/expert/plan_page.dart';
import 'package:sports_new/view/home/new_post_page.dart';
import 'package:sports_new/view/home/news_detail_page.dart';
import 'package:sports_new/view/home/home_page.dart';
import 'package:sports_new/view/home/news_transition.dart';
import 'package:sports_new/view/home/news_video_page.dart';
import 'package:sports_new/view/home/task/point_history_page.dart';
import 'package:sports_new/view/home/task/point_market_page.dart';
import 'package:sports_new/view/home/task/task_page.dart';
import 'package:sports_new/view/king/king_detail_page.dart';
import 'package:sports_new/view/king/king_history_page.dart';
import 'package:sports_new/view/king/king_rank_page.dart';
import 'package:sports_new/view/live/expert_rooms_page.dart';
import 'package:sports_new/view/live/live_create_page.dart';
import 'package:sports_new/view/live/live_push_page.dart';
import 'package:sports_new/view/live/live_statistics_page.dart';
import 'package:sports_new/view/match/basketball/lq_filter_page.dart';
import 'package:sports_new/view/match/config/lq_config_page.dart';
import 'package:sports_new/view/match/config/lq_odds_config_page.dart';
import 'package:sports_new/view/match/config/lq_odds_type_page.dart';
import 'package:sports_new/view/match/config/lq_push_config_page.dart';
import 'package:sports_new/view/match/config/odds_company_page.dart';
import 'package:sports_new/view/match/config/odds_show_page.dart';
import 'package:sports_new/view/match/config/zq_config_page.dart';
import 'package:sports_new/view/match/config/zq_odds_config_page.dart';
import 'package:sports_new/view/match/config/zq_odds_type_page.dart';
import 'package:sports_new/view/match/config/zq_push_config_page.dart';
import 'package:sports_new/view/match/config/zq_sound_page.dart';
import 'package:sports_new/view/match/soccer/zq_filter_page.dart';
import 'package:sports_new/view/match_detail/basketball/lq_detail_page.dart';
import 'package:sports_new/view/match_detail/soccer/zq_match_detail_page.dart';
import 'package:sports_new/view/my/account/my_account_certification_page.dart';
import 'package:sports_new/view/my/discount/my_discount_page.dart';
import 'package:sports_new/view/my/error_page.dart';
import 'package:sports_new/view/my/expert/my_expert_apply_page.dart';
import 'package:sports_new/view/my/expert/my_expert_apply_status_page.dart';
import 'package:sports_new/view/my/expert/my_expert_apply_type_page.dart';
import 'package:sports_new/view/my/help/feedback_history_page.dart';
import 'package:sports_new/view/my/my_avartars_page.dart';
import 'package:sports_new/view/my/my_coin_detail_page.dart';
import 'package:sports_new/view/my/my_coin_history_page.dart';
import 'package:sports_new/view/my/my_collection_page.dart';
import 'package:sports_new/view/my/my_contact_page.dart';
import 'package:sports_new/view/my/my_desc_edit_page.dart';
import 'package:sports_new/view/my/my_editinfo_page.dart';
import 'package:sports_new/view/my/my_focus_page.dart';
import 'package:sports_new/view/my/my_login_page.dart';
import 'package:sports_new/view/my/my_login_verify_page.dart';
import 'package:sports_new/view/my/my_name_edit_page.dart';
import 'package:sports_new/view/my/my_notify_setting_page.dart';
import 'package:sports_new/view/my/my_purchase_page.dart';
import 'package:sports_new/view/my/my_recharge_page.dart';
import 'package:sports_new/view/my/my_settings_page.dart';
import 'package:sports_new/view/my/my_system_msg_page.dart';
import 'package:sports_new/view/my/my_to_focus_page.dart';
import 'package:sports_new/view/my/my_web_page.dart';
import 'package:sports_new/view/my/sale_center/sale_center_page.dart';
import 'package:sports_new/view/my/user_page/user_page.dart';
import 'package:sports_new/view/no_privacy/zixun_detail.dart';
import 'package:sports_new/view/no_privacy/zixun_video_page.dart';
import 'package:sports_new/view/pick/ai/ai_example_page.dart';
import 'package:sports_new/view/pick/ai/ai_model_page.dart';
import 'package:sports_new/view/pick/ai/ai_type.dart';
import 'package:sports_new/view/pick/secret/secret_list_page.dart';
import 'package:sports_new/view/pick/subs/subs_article_page.dart';
import 'package:sports_new/view/pick/subs/subs_pay_page.dart';
import 'package:sports_new/view/search/search_page.dart';
import 'package:sports_new/view/team/basketball/lq_team_detail_page.dart';
import 'package:sports_new/view/team/soccer/zq_team_detail_page.dart';
import 'package:sports_new/view/vip/vip_free_page.dart';
import 'package:sports_new/view/vip/vip_page.dart';
import 'package:sports_new/widgets/share/share_sheet.dart';

import '../view/expert/plan_pack/plan_pack_history_page.dart';
import '../view/home/news_detail.dart';
import '../view/home/news_list_page.dart';
import '../view/king/king_page.dart';
import '../view/live/live_normal_page.dart';
import '../view/match_detail/basketball/lq_odds_detail_view.dart';
import '../view/match_detail/soccer/zq_data_bottom_dialog.dart';
import '../view/match_detail/soccer/zq_match_odds_detail_view.dart';
import '../view/my/account/my_account_bind_page.dart';
import '../view/my/help/feedback_detail_page.dart';
import '../view/my/help/feedback_page.dart';
import '../view/my/help/feedback_choice_page.dart';
import '../view/my/help/help_detail_page.dart';
import '../view/my/help/my_help_page.dart';
import '../view/my/my_inviter_page.dart';
import '../view/pick/ai/ai_detail_page.dart';
import '../view/pick/ai/ai_page.dart';
import '../view/pick/ai/ai_pay_page.dart';
import '../view/pick/secret/secret_pay_page.dart';
import '../view/pick/subs/subs_page.dart';
import '../view/record/single_channel_page.dart';

class PopupType {
  final String type;
  const PopupType({required this.type});

  static const PopupType dialog = PopupType(type: "dialog");
  static const PopupType bottomSheet = PopupType(type: "bottomSheet");
}

class GetPopup {
  PopupType type;
  Widget widget;

  GetPopup({required this.type, required this.widget});
}

class RoutesAgreement {
  // toService() async => await Get.toNamed(Routes.webview,
  //     arguments:
  //         const WebPara("", Constant.serviceAgreementUrl, longpress: true));
  // toPrivicy() async => await Get.toNamed(Routes.webview,
  //     arguments: const WebPara("", Constant.privacyPolicyUrl, longpress: true));
  // toRecharge() async => await Get.toNamed(Routes.webview,
  //     arguments: const WebPara("", Constant.payPolicyUrl, longpress: true));
  // toLess18() async => await Get.toNamed(Routes.webview,
  //     arguments: const WebPara("", Constant.less18PolicyUrl, longpress: true));
  // toSelfMedia() async => await Get.toNamed(Routes.webview,
  //     arguments:
  //         const WebPara("", Constant.selfmediaPolicyUrl, longpress: true));
}

class Routes {
  static const navigation = '/navigation';

  ///首页一级路径
  static const home = '/home';
  static const homeNewsAll = "/home/news/all";
  static const homeExpertTop = '/home/expert/top';
  static const planForm = '/expert/planForm';
  static const vipCenter = '/home/vip';

  ///资讯路径
  static const homenews = "/home/news";
  static const homeTask = "/home/task";
  static const homeVideoNews = "/home/videoNews";
  static const newPost = '/post/new';
  static const newsList = "/news/list";

  ///财经路径
  static const expert = '/expert';
  static const viewpoint = "/expert/viewpoint";
  static const expertApply = "/expert/apply";
  static const expertRequestType = "/my/requestType";
  static const expertAll = "/expert/all";
  static const expertTop = '/expert/top';
  static const expertLeagues = '/expert/leagues';
  static const expertLeagueList = '/expert/leagues/list';
  static const planFormDetail = '/expert/planForm/detail';
  static const planPack = '/expert/planPack';
  static const planPackDetail = '/expert/planPack/detail';
  static const planPackHistory = '/expert/planPack/history';

  ///比赛一级路径
  static const match = '/match';

  ///足球路径
  static const zqMatchDetail = '/soccer/detail';
  static const zqDataDialog = '/soccer/detail/dialog';
  static const zqOddsDetail = '/soccer/detail/oddsDetail';
  static const zqFilter = '/soccer/filter';
  static const zqConfig = "/soccer/config";
  static const zqOddsConfig = "/soccer/oddsConfig";
  static const zqOddsType = "/soccer/oddsType";
  static const zqPushConfig = "/soccer/pushConfig";
  static const zqSoundConfig = "/soccer/soundConfig";

  ///篮球路径
  static const lqMatchDetail = "/basket/detail";
  static const lqConfig = "/basketball/config";
  static const lqOddsConfig = "/basketball/oddsConfig";
  static const lqOddsType = "/basket/oddsType";
  static const lqOddsDetail = '/basket/detail/oddsDetail';
  static const lqPushConfig = "/basket/pushConfig";
  static const basketballFilter = "/basketball/filter";

  ///相关路径
  static const oddsCompany = "/odds/company";
  static const oddsShow = "/odds/show";
  static const lqTeamDetail = "/basket/teamDetail";
  static const leagueDetail = "/league/detail";
  static const zqTeamDetail = "/soccer/teamDetail";
  static const secretList = "/match/secretList";
  static const secretPay = "/secret/pay";

  ///直播一级路径
  static const live = '/live';

  ///智选一级路径
  static const pick = '/pick';
  static const ai = "/pick/ai";
  static const subscribe = "/pick/subs";

  ///ai路径
  static const aiRadar = "/pick/ai/radar";
  static const aiLm = "/pick/ai/lm";
  static const aiTrend = "/pick/ai/trend";
  static const aiFaith = "/pick/ai/faith";
  static const aiAssess = "/pick/ai/assess";
  static const aiPre = "/pick/ai/pre";
  static const aiBounce = "/pick/ai/bounce";
  static const aiCombo = "/pick/ai/combo";
  static const aiPlan = "/pick/ai/planCnt";
  static const aiDetail = "/pick/ai/detail";
  static const aiPay = "/pick/ai/pay";

  ///订阅路径
  static const subsPay = "/pick/subs/pay";
  static const subscribeArticle = "/pick/subscribe/article";

  ///数据一级路径
  static const data = '/data';

  ///数据二级路径
  static const dataPoints = "/record/dataPoints";
  static const dataSchedule = "/record/dataSchedule";
  static const dataOther = "/record/dataOther";

  ///我的一级路径
  static const my = '/my';

  ///我的二级路径
  static const myFocus = "/my/focus";
  static const myPurchase = "/my/purchase";
  static const myRecharge = "/my/recharge";
  static const myCoinHistory = "/my/coin/history";
  static const myCoinDetial = "/my/coin/detail";
  static const expertViewpoint = "/expert/viewpoint";
  static const mySetting = "/my/setting";
  static const myAboutus = "/my/aboutus";
  static const myPrivicySetting = "/my/privicySetting";
  static const myContact = "/my/contact";
  static const myEditInfo = "/my/editInfo";
  static const myEditName = "/my/editName";
  static const myEditDesc = "/my/editDesc";
  static const myPushSetting = "/my/pushSetting";
  static const myTofocusTeam = "/my/toFocusTeam";
  static const myCoupons = "/my/coupons";
  static const myMsg = "/my/msg";
  static const myCollection = '/my/collection';
  static const myInviter = '/my/inviter';
  static const feedback = '/my/feedback';
  static const feedbackChoice = '/my/feedbackChoice';
  static const viewReportChoice = '/my/viewReportChoice';
  static const liveReportChoice = '/my/liveReportChoice';
  static const feedbackHistory = '/my/feedback/history';
  static const feedbackDetail = '/my/feedbackDetail';
  static const helpDetail = '/my/helpDetail';
  static const saleCenter = '/my/saleCenter';

  ///活动路径
  static const king = '/king';
  static const kingHistory = '/king/history';
  static const kingDetail = '/king/detail';
  static const kingRank = '/king/rank';

  ///直播路径
  static const liveCreate = '/live/create';
  static const livePush = '/live/push';
  static const liveNormal = '/live/normal';
  static const expertRooms = '/live/rooms';
  static const liveStatistics = '/live/statistics';

  ///其他路径
  static const login = '/login';
  static const search = "/search";
  static const myLoginVerify = '/login/verify';
  static const webview = '/webview';
  static const taskPoints = "/home/task/points";
  static const pointMarket = "/home/task/market";
  static const userPage = '/user/page';
  static const expertApplySuccess = "/expert/apply/success";
  static const accountSafe = "/my/accountSafe";
  static const accountBind = "/my/accountBind";
  static const accountVerify = "/my/accountVerify";
  static const activity1zhe = "/activity/1zhe";
  static const activityBug = "/activity/bug";
  static const systemAvatars = "/my/systemAvatars";
  static const selectFocusTeam = "/focus/selectTeam";
  static const vipFree = '/vip/free';
  static const aiExample = '/ai/example';
  static const help = '/help';
  static const zixunDetail = '/zixun/detial';
  static const zixunVideo = '/zixun/video';
  static const error = "/error";

  static final agreements = RoutesAgreement();

  //各种弹窗路径
  static const share = '/share';
  static const contactWX = '/contact/wx';

  static List<String> popupRoutes = [Routes.share, Routes.contactWX];

  static List<GetPopup> popups = [
    GetPopup(type: PopupType.bottomSheet, widget: const ShareSheet()),
  ];

  static List<GetPage> getPages = [
    // GetPage(name: navigation, page: () => NavigationPage()),
    GetPage(name: home, page: () => const HomePage()),
    // GetPage(
    //     name: match,
    //     page: () => const MatchPage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: expert,
        page: () => const PlanPage(),
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: record,
    //     page: () => const DataPage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: king,
        page: () => const KingPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: login,
        page: () => const MyLoginPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myLoginVerify,
        page: () => const MyLoginVerifyPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqFilter,
        page: () => const ZqFilterPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqMatchDetail,
        page: () => const ZqMatchDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqDataDialog,
        page: () => const ZqDataBottomDialog(),
        opaque: false,
        fullscreenDialog: true),
    GetPage(name: zqOddsDetail, page: () => ZqMatchOddsDetailView()),
    GetPage(name: myMsg, page: () => const MySystemMsgPage()),
    GetPage(
        name: webview,
        page: () => const MyWebPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: homenews,
        page: () => const NewsDetail(),
        middlewares: [UmengMiddleware()],
        transitionDuration: const Duration(milliseconds: 100),
        customTransition: NewsTransition()),
    GetPage(
        name: homeNewsAll,
        page: () => const HomePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: homeTask,
        page: () => const TaskPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: taskPoints,
        page: () => const PointHistoryPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: pointMarket,
        page: () => const PointMarketPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: ai,
        page: () => const AiPage(showAppBar: true),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiRadar,
        page: () => const AiModelPage(),
        arguments: AiType.radar,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiAssess,
        page: () => const AiModelPage(),
        arguments: AiType.assess,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiFaith,
        page: () => const AiModelPage(),
        arguments: AiType.faith,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiTrend,
        page: () => const AiModelPage(),
        arguments: AiType.trend,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiLm,
        page: () => const AiModelPage(),
        arguments: AiType.lm,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiPre,
        page: () => const AiModelPage(),
        arguments: AiType.pre,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiBounce,
        page: () => const AiModelPage(),
        arguments: AiType.bounce,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiCombo,
        page: () => const AiModelPage(),
        arguments: AiType.combo,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiPlan,
        page: () => const AiModelPage(),
        arguments: AiType.plan,
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiDetail,
        page: () => const AiDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiPay,
        page: () => const AiPayPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
      name: newPost,
      page: () => const NewPostPage(),
      middlewares: [UmengMiddleware()],
    ),
    GetPage(
        name: subscribe,
        page: () => const SubsPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: subsPay,
        page: () => const SubsPayPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: subscribeArticle,
        page: () => const SubsArticlePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: homeVideoNews,
        page: () => const VideoNewsPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myRecharge,
        page: () => const RechargePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myFocus,
        page: () => const MyFocusPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myCoinHistory,
        page: () => const MyCoinHistoryPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myCoinDetial,
        page: () => const MyCoinDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myPurchase,
        page: () => const MyPurchasePage(),
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: expertViewpoint,
    //     page: () => const ViewpointPage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: mySetting,
        page: () => const MySettingsPage(),
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: myAboutus,
    //     page: () => const AboutUsPage(),
    //     middlewares: [UmMiddleware()]),
    // GetPage(
    //     name: myPrivicySetting,
    //     page: () => const PrivacySettingPage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: myContact,
        page: () => const MyContactPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myPushSetting,
        page: () => const MyNotifySettingPage(),
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: expertDetail,
    //     page: () => const ExpertDetailPage(),
    //     parameters: const {"index": "0"},
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: search,
        page: () => const SearchPage(),
        middlewares: [UmengMiddleware()],
        transition: Transition.noTransition,
        transitionDuration: const Duration(milliseconds: 300)),
    GetPage(
        name: viewpoint,
        page: () => const ViewpointPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertApply,
        page: () => const MyExpertApplyPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertRequestType,
        page: () => MyExpertApplyTypePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertAll,
        page: () => ExpertAllPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertApplySuccess,
        page: () => const MyExpertApplyStatusPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: newsList,
        page: () => const NewsListPage(),
        middlewares: [UmengMiddleware()]),
    // // GetPage(
    // //     name: dataPoints,
    // //     page: () => const DataPointsPage(),
    // //     middlewares: [UmMiddleware()]),
    // // GetPage(
    // //     name: dataSchedule,
    // //     page: () => const DataSchedulePage(),
    // //     middlewares: [UmMiddleware()]),
    GetPage(
        name: leagueDetail,
        page: () => SingleChannelPage(),
        parameters: const {"index": "0", "type": "0"},
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: accountSafe,
    //     page: () => const AccountSafePage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: accountBind,
        page: () => const MyAccountBindPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: accountVerify,
        page: () => const MyAccountCertificationPage(),
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: activity1zhe,
    //     page: () => Activity1zhePage(),
    //     middlewares: [UmMiddleware()]),
    // GetPage(
    //     name: activityBug,
    //     page: () => const ActivityBugPage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: myCoupons,
        page: () => const MyDiscountPage(),
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: soccerTeamDetail,
    //     page: () => const SoccerTeamDetailPage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: systemAvatars,
        page: () => const MyAvartarsPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqTeamDetail,
        page: () => const ZqTeamDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: secretList,
        page: () => const SecretListPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: secretPay,
        page: () => const SecretPayPage(),
        middlewares: [UmengMiddleware()]),
    // GetPage(
    //     name: systemAvatars,
    //     page: () => const SystemAvatarsPage(),
    //     middlewares: [UmMiddleware()]),
    // GetPage(
    //     name: selectFocusTeam,
    //     page: () => const SelectFocusTeamPage(),
    //     middlewares: [UmMiddleware()]),
    GetPage(
        name: zqConfig,
        page: () => const ZqConfigPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqOddsConfig,
        page: () => const ZqOddsConfigPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqOddsType,
        page: () => const ZqOddsTypePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: oddsCompany,
        page: () => const OddsCompanyPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: oddsShow,
        page: () => const OddsShowPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqPushConfig,
        page: () => const ZqPushConfigPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: zqSoundConfig,
        page: () => const ZqSoundPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: lqConfig,
        page: () => const LqConfigPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: lqOddsConfig,
        page: () => const LqOddsConfigPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: lqOddsType,
        page: () => const LqOddsTypePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: lqPushConfig,
        page: () => const LqPushConfigPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: lqMatchDetail,
        page: () => const LqDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(name: lqOddsDetail, page: () => LqOddsDetailView()),
    GetPage(
        name: basketballFilter,
        page: () => const LqFilterPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: lqTeamDetail,
        page: () => const LqTeamDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myEditInfo,
        page: () => const MyEditInfoPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myEditName,
        page: () => const MyNameEditPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myEditDesc,
        page: () => const MyDescEditPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myTofocusTeam,
        page: () => const My2FocusTeamPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: userPage,
        page: () => const UserPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myCollection,
        page: () => const MyCollectionPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: myInviter,
        page: () => const MyInviterPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: feedback,
        page: () => const FeedbackPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: feedbackChoice,
        page: () => const FeedbackChoicePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: viewReportChoice,
        page: () => const FeedbackChoicePage.viewReport(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: liveReportChoice,
        page: () => const FeedbackChoicePage.liveReport(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: feedbackHistory,
        page: () => const FeedbackHistoryPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: feedbackDetail,
        page: () => const FeedbackDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: helpDetail,
        page: () => const HelpDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: saleCenter,
        page: () => const SaleCenterPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: kingDetail,
        page: () => const KingDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: kingRank,
        page: () => const KingRankPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: kingHistory,
        page: () => const KingHistoryPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertTop,
        page: () => const ExpertTopPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertLeagues,
        page: () => const ExpertLeaguesPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertLeagueList,
        page: () => const ExpertLeagueListPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: planFormDetail,
        page: () => const PlanFormDetailPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: homeExpertTop,
        page: () => const ExpertTopPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: planForm,
        page: () => const PlanFormPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: vipCenter,
        page: () => const VipPage(showAppBar: true),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: vipFree,
        page: () => const VipFreePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: aiExample,
        page: () => const AiExamplePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: liveCreate,
        page: () => const LiveCreatePage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: livePush,
        page: () => const LivePushPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: liveNormal,
        page: () => LiveNormalPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: expertRooms,
        page: () => const ExpertRoomsPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(
        name: liveStatistics,
        page: () => const LiveStatisticsPage(),
        middlewares: [UmengMiddleware()]),
    GetPage(name: help, page: () => const MyHelpPage()),
    GetPage(name: zixunDetail, page: () => const ZixunDetailPage()),
    GetPage(name: zixunVideo, page: () => const ZixunVideoPage()),
    GetPage(name: error, page: () => const ErrorPage()),
    GetPage(name: planPack, page: () => const PlanPackPage()),
    GetPage(name: planPackHistory, page: () => const PlanPackHistoryPage()),
    GetPage(name: planPackDetail, page: () => const PlanPackDetailPage()),
  ];

  static bool isRouteExists(String route){
    for (var value in getPages) {
      if(value.name == route){
        return true;
      }
    }
    return false;
  }

  static Future toPage(
    String page, {
    dynamic arguments,
    bool preventDuplicates = true,
    Map<String, String>? parameters,
  }) async {
    if (popupRoutes.contains(page)) {
      GetPopup popup = popups[popupRoutes.indexOf(page)];
      if (popup.type == PopupType.dialog) {
        Get.dialog(popup.widget,
            routeSettings: RouteSettings(arguments: arguments));
      } else if (popup.type == PopupType.bottomSheet) {
        Get.bottomSheet(popup.widget,
            settings: RouteSettings(arguments: arguments),
            useRootNavigator: true);
      }
    } else {
      Get.toNamed(page, arguments: arguments, parameters: parameters);
    }
  }
}
